import { get, post, put, del } from '@/utils/request'

export const addAlbum = async (data: any) => {
    try {
        const response = await post<any>('/albumCollection/add', data);
        return response;
    } catch (error) {
    }
};

export const updateAlbum = async (data: any) => {
    try {
        const response = await post<any>('/albumCollection/update', data);
        return response;
    } catch (error) {
    }
};

export const page = async (data: any) => {
    try {
        const response = await post<any>('/albumCollection/page', data);
        return response;
    } catch (error) {
    }
};


export const deleteAlbum = async (data: any) => {
    try {
        const response = await post<any>('/albumCollection/delete', data);
        return response;
    } catch (error) {
    }
};

export const listAllFileId = async (data: any) => {
    try {
        const response = await post<any>('/albumCollection/listAllFileId', data);
        return response;
    } catch (error) {
    }
};

export const getPreviewFileId = async (data: any) => {
    try {
        const response = await post<any>('/albumCollection/getPreviewFileId', data);
        return response;
    } catch (error) {
    }
};

export const coverFileSetting = async (data: any) => {
    try {
        const response = await post<any>('/albumCollection/coverFileSetting', data);
        return response;
    } catch (error) {
    }
};

export const fileSetting = async (data: any) => {
    try {
        const response = await post<any>('/albumCollection/fileSetting', data);
        return response;
    } catch (error) {
    }
};

export const listAll = async () => {
    try {
        const response = await post<any>('/albumCollection/listAll');
        return response;
    } catch (error) {
    }
};

export const inviteFamilyGroup = async (data: any) => {
    try {
        const response = await post<any>('/albumCollection/inviteFamilyGroup', data);
        return response;
    } catch (error) {
    }
};

export const familyGroupPage = async (data: any) => {
    try {
        const response = await post<any>('/albumCollection/familyGroupPage', data);
        return response;
    } catch (error) {
    }
};

export const submitInviteResult = async (data: any) => {
    try {
        const response = await post<any>('/albumCollection/submitInviteResult', data);
        return response;
    } catch (error) {
    }
};

export const intervalPendingTask = async () => {
    try {
        const response = await get<any>('/albumCollection/intervalPendingTask');
        return response;
    } catch (error) {
    }
};


export interface PendingTask {
    id: number,
    userId: number,
    type: number,
    title: string,
    content: string,
    remark: string,
}
export interface IntervalPendingTaskVo {
    showList: PendingTask[],
    pendingTaskList: PendingTask[],
}
export interface QueryParams {
    pageNum: number,
    pageSize: number,
    collectionName: string,
}
export interface AlbumPageData {
    id: number,
    collectionName: string,
    coverFilePreviewUrl: string,
    fileUrlList: string[],
    createTime: string,
}
export interface Album {
    id: number,
    collectionName: string,
    coverFileId: number,
    fileIdList: string,
}
export interface PageData {
    // 总条数
    totalNum: number,
    tableData: AlbumPageData[]
}
export interface AlbumAddRequest {
    id: number | null,
    collectionName: string,
}
export interface SelectedFileIdListResponse {
    status: number,
    data: number[],
    msg: string,
}
export interface SelectedCoverFileIdResponse {
    status: number,
    data: number,
    msg: string,
}
export interface AlbumCollectionData {
    id: number,
    collectionName: string,
    coverFilePreviewUrl: string,
    fileUrlList: string[],
    createTime: string,
}
export interface InviteRequest {
    wxNickName: string,
}
export interface AlbumCollectionRequest {
    id: number | null,
    coverFileId: number,
    fileIdList: number[],
}